/*
 * CSS Custom Properties used by Device.tsx component:
 * 
 * Wrapper container positioning and sizing:
 * --phone-wrapper-min-width: Minimum width for the phone wrapper container (auto)
 * --phone-wrapper-min-height: Minimum height for the phone wrapper container (350px)
 * --phone-wrapper-height: Height of the phone wrapper container (100% for fit, calculated px for zoom)
 * 
 * Device content positioning and sizing:
 * --phone-content-min-height: Minimum height for phone content (350px or none)
 * --phone-content-min-width: Minimum width for phone content (fit-content or calculated px)
 * --phone-content-width: Current width of phone content (auto for portrait, calculated for landscape)
 * --phone-content-height: Current height of phone content (calculated based on zoom/fit mode)
 * --phone-aspect-ratio: Aspect ratio of the device frame (width/height for portrait, inverted for landscape)
 * 
 * Screen positioning and sizing:
 * --phone-screen-height: Height of the screen area as percentage of frame
 * --phone-screen-width: Width of the screen area as percentage of frame
 * --phone-top: Top offset of screen area as percentage of frame
 * --phone-left: Left offset of screen area as percentage of frame
 * 
 * Touch area positioning and sizing:
 * --phone-touch-area-width: Width of the touch area (screen width + padding)
 * --phone-touch-area-height: Height of the touch area (screen height + padding)
 * --phone-touch-area-top: Top offset of touch area
 * --phone-touch-area-left: Left offset of touch area
 * --phone-touch-area-screen-width: Width of the screen within touch area
 * --phone-touch-area-screen-height: Height of the screen within touch area
 * --phone-touch-area-screen-top: Top offset of screen within touch area
 * --phone-touch-area-screen-left: Left offset of screen within touch area
 * 
 * Device appearance:
 * --phone-mask-image: URL to the device mask image for screen clipping
 * --phone-frame-image: URL to the device frame image (used in .phone-bezel)
 * 
 * Transform properties:
 * --frame-rotation: CSS rotation for device frame orientation (0deg or 180deg)
 */

.phone-display-container {
  flex: 1;
  display: flex;
  justify-content: safe center;
  align-items: safe center;
  overflow: auto;
  width: 100%;
  position: relative;
  user-select: none;
}

.phone-display-container:hover,
.phone-display-container:focus-visible {
  outline: none;
}

.phone-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-width: var(--phone-wrapper-min-width);
  min-height: var(--phone-wrapper-min-height);
  width: var(--phone-wrapper-width);
  height: var(--phone-wrapper-height);
}

.phone-content {
  position: relative;
  display: flex;
  aspect-ratio: var(--phone-aspect-ratio);
  width: calc(var(--phone-content-width));
  height: var(--phone-content-height);
  min-height: var(--phone-content-min-height); /* 350px */
  min-width: var(--phone-content-min-width); /* 350px × phones aspect ratio */
  object-fit: scale-down;
}

.touch-area {
  position: absolute;
  width: var(--phone-screen-width);
  height: var(--phone-screen-height);
  top: var(--phone-top);
  left: var(--phone-left);
  user-select: none;
}

.phone-sized {
  position: absolute;
  width: calc(var(--phone-screen-width));
  height: var(--phone-screen-height);
  top: var(--phone-top);
  left: calc(var(--phone-left));
  -webkit-mask-image: var(--phone-mask-image);
  mask-image: var(--phone-mask-image);
  -webkit-mask-size: cover;
  mask-size: cover;
  user-select: none;
  background-color: black;
}

.phone-screen {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0px;
  left: 0px;
  -webkit-mask-image: var(--phone-mask-image);
  mask-image: var(--phone-mask-image);
  -webkit-mask-size: cover;
  mask-size: cover;
  user-select: none;
}

.phone-bezel-image {
  opacity: 0;
}

.phone-bezel {
  -webkit-mask-image: var(--phone-frame-image);
  mask-image: var(--phone-frame-image);
  -webkit-mask-size: cover;
  mask-size: cover;
  background-color: var(--swm-separator);
  aspect-ratio: var(--phone-aspect-ratio);
  box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
}

.phone-frame {
  pointer-events: none;
  rotate: var(--frame-rotation);
  width: 100%;
}

.extension-error-screen {
  background-color: var(--background-dark-120);
}

.phone-inspect-overlay {
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  overflow: hidden;
  pointer-events: none;
}

.inspect-area {
  position: absolute;
  background-color: var(--inspect-area-background);
}

.phone-debug-overlay {
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.phone-refreshing-overlay {
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 0;
  display: flex;
  gap: 1em;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  transition: opacity 0.3s ease;
  transition-delay: 3s;
}

.phone-refreshing-overlay:active {
  opacity: 1;
  transition-delay: 0s;
}

.uncaught-button {
  display: flex;
  align-items: center;
  background-color: #ff6259;
  border-radius: 10px;
  border: 1px solid #e65f50;
  padding: 5px;
  color: #001a72;
}

.phone-error-overlay {
  background-color: rgba(255, 106, 89, 0.85);
  color: #001a72;
}

.phone-content-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
}

.phone-content-loading-background {
  background-color: var(--swm-phone-content-loading-background);
}

.touch-indicator {
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  background-color: var(--touch-indicator-background);
  border-radius: 50%;
  border: 1px solid;
  border-color: var(--touch-indicator-border);
  width: var(--size);
  height: var(--size);
  transform: translate(-50%, -50%);
  opacity: 0.6;
}

.touch-indicator.pressed {
  background-color: var(--touch-indicator-pressed-background);
  border-color: var(--touch-indicator-pressed-border);
  box-shadow: var(--touch-indicator-pressed-shadow);
}

.button-group-left-wrapper {
  position: absolute;
  left: 0px;
  top: 50%;
  width: 50px;
  height: 150px;
  transform: translateY(-50%);
}

.button-group-left {
  display: flex;
  position: absolute;
  left: 10px;
  transform: translate(-40px, 21px);
  transition: transform 0.3s ease 0.1s;
}

.button-group-left-wrapper:hover .button-group-left,
.button-group-left:has(.zoom-controls.select-open) {
  transform: translate(0px, 21px);
}

.phone-preload-masks {
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  left: -10000px;
}
